/**   
 * 项目名：phms3
 * 日期：    2019-11-22 22:20:03  
 * Copyright (c) 2015- HTSC-版权所有     
 */

package com.joysuch.wwyt.risk.entity;

import cn.zlg.common.springmvc.validate.constraints.NotNull;
import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import com.joysuch.wwyt.dataperm.annotation.DataPermissionField;
import com.joysuch.wwyt.dataperm.enums.DataPermissionFilterType;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "WWYT_RISK_SHOULD_KNOW_CARD")
@SQLDelete(sql = "update WWYT_RISK_SHOULD_KNOW_CARD set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update WWYT_RISK_SHOULD_KNOW_CARD set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class RiskShouldKnowCard implements java.io.Serializable {

    // columns START
    // ID
    private java.lang.Long id;
    // 编号
    private java.lang.String code;
    // 风险区域ID
    @NotNull(field = "风险区域")
    @DataPermissionField(type = DataPermissionFilterType.JOIN_TABLE,
            sqlColumn = "risk_district_id", joinInfo = {"wwyt_risk_district", "id",
            "responsible_dept" })
    private java.lang.Long riskDistrictId;
    // 正文
    @NotNull(field = "正文")
    private java.lang.String content;
    // 描述
    private java.lang.String description;
    // 状态
    private java.lang.Integer state;
    // 创建人
    private java.lang.Long createBy;
    // 创建时间
    private java.util.Date createTime;
    // 更新人
    private java.lang.Long updateBy;
    // 更新时间
    private java.util.Date updateTime;
    // 删除标记
    private java.lang.String deleteFlag;
    // 组织结构代码
    private java.lang.String orgCode;
    // 租户
    private java.lang.Long tenentId;
    // columns END

    //岗位
    private Long jobId;
    //风险等级
    private String riskLevel;
    //安全警示标示
    private String safeWarnMark;
    //主要危险有害因素
    private String mainDangerFactor;
    //易导致事故风险
    private String accidentRisk;
    //风险管控措施
    private String riskControlAction;
    //应急处置对策
    private String urgentCountermeasure;
    // 附件id
    private Long attachmentId;

    public Long getJobId() {
        return jobId;
    }

    public void setJobId(Long jobId) {
        this.jobId = jobId;
    }

    public String getRiskLevel() {
        return riskLevel;
    }

    public void setRiskLevel(String riskLevel) {
        this.riskLevel = riskLevel;
    }

    public String getSafeWarnMark() {
        return safeWarnMark;
    }

    public void setSafeWarnMark(String safeWarnMark) {
        this.safeWarnMark = safeWarnMark;
    }

    public String getMainDangerFactor() {
        return mainDangerFactor;
    }

    public void setMainDangerFactor(String mainDangerFactor) {
        this.mainDangerFactor = mainDangerFactor;
    }

    public String getAccidentRisk() {
        return accidentRisk;
    }

    public void setAccidentRisk(String accidentRisk) {
        this.accidentRisk = accidentRisk;
    }

    public String getRiskControlAction() {
        return riskControlAction;
    }

    public void setRiskControlAction(String riskControlAction) {
        this.riskControlAction = riskControlAction;
    }

    public String getUrgentCountermeasure() {
        return urgentCountermeasure;
    }

    public void setUrgentCountermeasure(String urgentCountermeasure) {
        this.urgentCountermeasure = urgentCountermeasure;
    }

    public void setId(java.lang.Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public java.lang.Long getId() {
        return this.id;
    }

    @Column(name = "CODE", length = 10, unique = true)
    public java.lang.String getCode() {
        return this.code;
    }

    public void setCode(java.lang.String value) {
        this.code = value;
    }

    @Column(name = "RISK_DISTRICT_ID")
    public java.lang.Long getRiskDistrictId() {
        return this.riskDistrictId;
    }

    public void setRiskDistrictId(java.lang.Long value) {
        this.riskDistrictId = value;
    }

    @Column(name = "CONTENT", length = 16777215)
    public java.lang.String getContent() {
        return this.content;
    }

    public void setContent(java.lang.String value) {
        this.content = value;
    }

    @Column(name = "DESCRIPTION", length = 200)
    public java.lang.String getDescription() {
        return this.description;
    }

    public void setDescription(java.lang.String value) {
        this.description = value;
    }

    @Column(name = "STATE")
    public java.lang.Integer getState() {
        return this.state;
    }

    public void setState(java.lang.Integer value) {
        this.state = value;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public java.lang.Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(java.lang.Long value) {
        this.createBy = value;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.util.Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public java.lang.Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(java.lang.Long value) {
        this.updateBy = value;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.util.Date getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.util.Date value) {
        this.updateTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public java.lang.String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(java.lang.String value) {
        this.deleteFlag = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public java.lang.String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(java.lang.String value) {
        this.orgCode = value;
    }

    @Column(name = "TENENT_ID")
    public java.lang.Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(java.lang.Long value) {
        this.tenentId = value;
    }

    @Column(name = "attachment_id")
    public Long getAttachmentId() {
        return attachmentId;
    }

    public void setAttachmentId(Long attachmentId) {
        this.attachmentId = attachmentId;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId()).append("code", getCode())
                .append("riskDistrictId", getRiskDistrictId()).append("content", getContent())
                .append("description", getDescription()).append("state", getState()).append("createBy", getCreateBy())
                .append("createTime", getCreateTime()).append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime()).append("deleteFlag", getDeleteFlag())
                .append("orgCode", getOrgCode()).append("tenentId", getTenentId()).toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof RiskShouldKnowCard == false)
            return false;
        if (this == obj)
            return true;
        RiskShouldKnowCard other = (RiskShouldKnowCard) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
